<?php

/**
 * Created by PhpStorm.
 * User: DMF
 * Date: 2017/5/25
 * Time: 15:35
 */

namespace Home\Model;
use Think\Model;

class ListModel extends Model
{
    private $_modelvediolist,//哪部视频的全部分集视频
            $_modellist;//哪部视频
    public function __construct(){
        parent::__construct();
        $this->_modelvediolist = M('vediolist');
        $this->_modellist = M('list');
    }
    public function cate(){

        $arr[0] = $this->_modellist->where('type=0')->select();
        $arr[1] = $this->_modellist->where('type=1')->select();
        $arr[2] = $this->_modellist->where('type=2')->select();

        return $arr;
    }
    public function selec($id){
        $tar[0] = $this->_modellist->where('id='.$id)->find();
        $tar[1] = $this->_modelvediolist->where('belong='.$id)->select();
        return $tar;
    }
    public function find($id){
        $tar = $this->_modelvediolist->where('id='.$id)->find();
        return $tar;
    }
    public function carton($cur=0,$sum=8){
        return $this->_modellist->where('type=0')->limit($cur,$sum)->select();
    }
    public function movice($cur=0,$sum=8){
        return $this->_modellist->where('type=1')->limit($cur,$sum)->select();
    }
    public function tv($cur=0,$sum=8){
        return $this->_modellist->where('type=2')->limit($cur,$sum)->select();
    }
}